﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Configuration;

namespace BHair.Base
{
    public partial class frm级别增加 : Form
    {
        public frm级别增加()
        {
            InitializeComponent();
        }
        string constr = ConfigurationManager.ConnectionStrings["BHair.Properties.Settings.BHairDBConnectionString"].ConnectionString;
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox2.Text != string.Empty && textBox1.Text != string.Empty)
            {
                SqlConnection conn = new SqlConnection(constr);
                conn.Open();
                string str = string.Format("INSERT INTO [会员级别] ([级别],[积分额度],积分率,倍数)  VALUES ('{0}' ,'{1}','{2}','{3}')", textBox1.Text, textBox2.Text,textBox3.Text,textBox4.Text);

                SqlCommand comm = new SqlCommand(str, conn);
                comm.ExecuteNonQuery();
                conn.Close();
                this.Close();
            }
            else
            {
                MessageBox.Show("请正确填写");
            }
        }
    }
}
